package cn.tedu.array;/**
 * @Author 金帮嘉诚 @Date 2021-06-25 星期五 21:31
 */
/**知识点*/
/*本类用于练习数组遍历*/
//需求：输出一年中每个月的天数
public class TestArrayExec {
    public static void main(String[] args) {
        //1.创建
        /**1 3 5 7 8 10 腊，31天永不差*/
        int[] days= {31,28,31,30,31,30,31,31,30,31,30,31};
        String[] month= {"January","Febrary","March","April","May","June","July","August","September","November","October","December"};
        //2.输出
        //遍历
        //从哪开始
        //到哪结束
        //如何变化
        System.out.println("days.length = "+days.length);
        for(int i=1;i<=days.length;i++) {
            System.out.println(i+"月份有"+days[i-1]+"天");
        }
        System.out.println();
        for(int i =0;i<days.length;i++) {
            System.out.println(month[i]+":"+days[i]+"days");
        }

    }
}
